<?php

include 'config.php';
include 'session.php';
include 'manager/AuthenticationManager.php';
include 'manager/SessionManager.php';
include 'manager/MessageBroker.php';

$login = $_REQUEST[$PARAM_LOGIN];
$password = $_REQUEST[$PARAM_PASSWORD];

$authorized = MessageBroker::getInstance()->getAuthenticationManager()->isAuthorizedUser($login, $password);
if ($authorized){
//	$session = 
	MessageBroker::getInstance()->getSessionManager()->createSession();
	Session::setAddress($_SERVER["REMOTE_ADDR"]);
}

//$TEST1 = $_SERVER["HTTP_CLIENT_IP"];
//$TEST2 = $_SERVER["HTTP_X_FORWARDED_FOR"];
//$TEST3 = $_SERVER["HTTP_X_FORWARDED"];
//$TEST4 = $_SERVER["REMOTE_ADDR"];
//echo "ip:$TEST1, $TEST2, $TEST3, $TEST4";

//sleep($PUSH_AUTH_DELAY);

/*
// set the cache limiter to 'private'
session_cache_limiter('private');

$cache_limiter = session_cache_limiter();


$cache_expire = session_cache_expire();
*/

?>
